<?php
/**
 * 会员角色接口
 * @author maniac
 */
namespace app\api\controller\v1;

use app\facade\Forms AS FormsFacade;

class Forms extends Base
{
    /**
     * 获取 form 表单字段
     */
    public function form()
    {
        $dbname  = input('param.dbname/s', '');
        $form_id = input('param.form_id/d', 0);
        $id      = input('param.id/d', 0);
        $type    = input('param.type/s', '');
        if (!$dbname || !$form_id) return j(1, '非法参数');
        try {
            $data['html'] = FormsFacade::forms($dbname, $form_id, $id, $type);
            return j(0, '获取表单成功', $data);
        } catch (\Exception $e) {
            return j(1, '获取表单失败', $e->getMessage());
        }
    }
}
